/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB3D_HARD_MACX_TEXTURE_H__
#define __LIB3D_HARD_MACX_TEXTURE_H__

#include <lib3d/hard/Texture.h>
#include <opengl/gl.h>

namespace liba
{
namespace lib3d
{
namespace hard
{
namespace macx
{
class Hardware;

class Texture : public hard::Texture
{
protected:
	GLuint texture;

	bool valid_flag;
	int dec_scale;

	unsigned char * locked_data;
public:
	explicit Texture(Hardware * hardware, int mipmap_levels, const pictureformat::Format & desired_format, int width, int height, int max_texture_size );
	virtual ~Texture();
	virtual void * lock(int mipmap_level, int * stride);
	virtual void unlock(int mipmap_level);
	virtual bool is_valid();
	virtual bool set_in_hardware(int stage);
};


} // namespace macx
} // namespace hard
} // namespace lib3d
} // namespace liba
using namespace liba;

#endif //__LIB3D_HARD_MACX_TEXTURE_H__